package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.WebServiceUtil;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.bo.ZhcaSmallappAddBo;
import com.ruoyi.system.bo.ZhcaSmallappEditBo;
import com.ruoyi.system.bo.ZhcaSmallappQueryBo;
import com.ruoyi.system.service.IZhcaSmallappService;
import com.ruoyi.system.vo.ZhcaSmallappVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 小程序Controller
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Validated
@Api(value = "小程序控制器", tags = {"小程序管理"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/system/getSmokeSensation")
public class SmokeSensationController extends BaseController {


	@ApiOperation("获取烟感token")
	//@PreAuthorize("@ss.hasPermi('system:myreport:export')")
	@GetMapping("/gettoken")
    public String gettoken() {
		String json = "{\n" +
			"    \"appkey\": \"RVpqZp6EAG36iDVE5p8abCT3\",\n" +
			"    \"masterSecret\": \"0z4BnyCeGNUJUHrSfM7YN3V4XSc6io\"\n" +
			"}";
		//PostMessage("https://www.zxyun119.com:443/thirdPartyApi/login/api/2.0/auth/getToken",json,null);
		String message = WebServiceUtil.PostMessage("https://www.zxyun119.com:443/thirdPartyApi/login/api/2.0/auth/getToken",json,null);
        return message;
    }

	@ApiOperation("获取烟感坐标")
	//@PreAuthorize("@ss.hasPermi('system:myreport:export')")
	@GetMapping("/getProjectListInfo")
	public String getProjectListInfo(String token) {
		String message = WebServiceUtil.GetMessage("https://www.zxyun119.com:443/thirdPartyApi/ThreePlaceREST/api/2.0/project/getProjectListInfo?pageNum=1&pageSize=10",null,token);
		//String message = WebServiceUtil.GetMessage("https://www.zxyun119.com:443/thirdPartyApi/ThreePlaceREST/api/2.0/getPlaceListInfo?projectId=052170ef41704d0298f99364a0c7e88f&pageSize=3000",null,token);
		return message;
	}


	@ApiOperation("获取烟感坐标")
	//@PreAuthorize("@ss.hasPermi('system:myreport:export')")
	@GetMapping("/getProjectListInfo2")
	public String getProjectListInfo2(String token) {
		//String message = WebServiceUtil.GetMessage("https://www.zxyun119.com:443/thirdPartyApi/ThreePlaceREST/api/2.0/project/getProjectListInfo?pageNum=1&pageSize=10",null,token);
		String message = WebServiceUtil.GetMessage("https://www.zxyun119.com:443/thirdPartyApi/ThreePlaceREST/api/2.0/getPlaceListInfo?projectId=052170ef41704d0298f99364a0c7e88f&pageSize=3000",null,token);
		return message;
	}



}
